use share_average

xtset id year

gen logtop1=log(top1)
gen lognext9=log(next9)
gen logmiddle40=log(middle40)
gen logbottom50=log(bottom50)
gen loggdp=log(gdp_adult)

xtreg logtop1 loggdp i.year if oecd!=. & year>=1990, fe
xtreg lognext9 loggdp i.year if oecd!=. & year>=1990, fe
xtreg logmiddle40 loggdp i.year if oecd!=. & year>=1990, fe
xtreg logbottom50 loggdp i.year if oecd!=. & year>=1990, fe

xtreg logtop1 loggdp i.year if oecd==1 & year>=1990, fe
xtreg lognext9 loggdp i.year if oecd==1 & year>=1990, fe
xtreg logmiddle40 loggdp i.year if oecd==1 & year>=1990, fe
xtreg logbottom50 loggdp i.year if oecd==1 & year>=1990, fe

xtreg logtop1 loggdp i.year if oecd==0 & year>=1990, fe
xtreg lognext9 loggdp i.year if oecd==0 & year>=1990, fe
xtreg logmiddle40 loggdp i.year if oecd==0 & year>=1990, fe
xtreg logbottom50 loggdp i.year if oecd==0 & year>=1990, fe



forvalues k=1/175 {
reg logtop1 loggdp if year>=1990 & id==`k', robust
eststo analy_`k', title(id_`k')
}
esttab analy_* using "C:\Users\user\OneDrive - konkuk.ac.kr\research\my papers\new papers\growth_benefit\beta_top1_since1990.csv" , b(3) replace mtitle nostar
eststo clear

forvalues k=1/175 {
reg lognext9 loggdp if year>=1990 & id==`k', robust
eststo analy_`k', title(id_`k')
}
esttab analy_* using "C:\Users\user\OneDrive - konkuk.ac.kr\research\my papers\new papers\growth_benefit\beta_next9_since1990.csv" , b(3) replace mtitle nostar
eststo clear

forvalues k=1/175 {
reg logmiddle40 loggdp if year>=1990 & id==`k', robust
eststo analy_`k', title(id_`k')
}
esttab analy_* using "C:\Users\user\OneDrive - konkuk.ac.kr\research\my papers\new papers\growth_benefit\beta_middle40_since1990.csv" , b(3) replace mtitle nostar
eststo clear

forvalues k=1/175 {
reg logbottom50 loggdp if year>=1990 & id==`k', robust
eststo analy_`k', title(id_`k')
}
esttab analy_* using "C:\Users\user\OneDrive - konkuk.ac.kr\research\my papers\new papers\growth_benefit\beta_bottom50_since1990.csv" , b(3) replace mtitle nostar
eststo clear
